<template>
	<view>
		<view class="u-m-b-20 box-color box-padding">
			<view class="u-flex u-row-between" >
				<text class="u-font-32">商品评价({{ commentCount }})</text>
				<text class="u-font-26 grey-color" @click="toPage">查看全部</text>
			</view>
			<view class="u-border-bottom" v-for="(item, index) in comment" :key="index">
				<view class="u-flex u-m-t-30">
					<view>
						<image :src="item.headImg" style="width: 80rpx;height: 80rpx;border-radius: 50%;" mode=""></image>
					</view>
					<view class="u-m-l-20">
						<view class="u-font-28">{{ item.nickname }}</view>
						<view class="u-font-24 grey-color">{{$fui.dateFormatter(item.createdTime, 'y-m-d h:i')}}</view>
					</view>
				</view>
				<view style="padding: 26rpx 0;font-size: 28rpx;">
					{{ item.comment }}
				</view>
			</view>
			<!-- <view class="u-border-bottom">
				<view class="u-flex u-m-t-30">
					<view>
						<image src="/static/18.jpg" style="width: 80rpx;height: 80rpx;border-radius: 50%;" mode=""></image>
					</view>
					<view class="u-m-l-20">
						<view class="u-font-28">SUN漂亮</view>
						<view class="u-font-24 grey-color">2020-08-30</view>
					</view>
				</view>
				<view style="padding: 26rpx 0;font-size: 28rpx;">
					林徳莱姆手工金酒销量不错！！！
				</view>
			</view>
			<view class="u-border-bottom">
				<view class="u-flex u-m-t-30">
					<view>
						<image src="/static/18.jpg" style="width: 80rpx;height: 80rpx;border-radius: 50%;" mode=""></image>
					</view>
					<view class="u-m-l-20">
						<view class="u-font-28">SUN漂亮</view>
						<view class="u-font-24 grey-color">2020-08-30</view>
					</view>
				</view>
				<view style="padding: 26rpx 0;font-size: 28rpx;">
					林徳莱姆手工金酒销量不错！！！
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			itemId: {
				type: String,
				default: '',
			},
			comment: {
				type: Array,
				default: []
			},
			commentCount: {
				type: Number,
				default: 0
			}
		},
		methods: {
			toPage() {
				if (this.comment.length == 0) {
					return this.$u.toast('该商品还没有评论')
				}
				this.$mRouter.push({ route: '/pages/index/pingjia?id='+this.itemId })
			}
		}
	}
</script>

<style>
</style>
